package com.huopaolan.yohuoshop.Adapter;

import android.util.Log;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.huopaolan.yohuoshop.Bean.HomeRecommendEntity;
import com.huopaolan.yohuoshop.NetWork.API;
import com.huopaolan.yohuoshop.R;

/**
 * 首页推荐接口  列表适配器
 */
public class HomeRecommendAdapter extends BaseQuickAdapter<HomeRecommendEntity.Values, BaseViewHolder> {


    public HomeRecommendAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomeRecommendEntity.Values item) {
        ImageView imageView = helper.getView(R.id.iv_item_recommend_url);
        Glide.with(helper.itemView.getContext()).load(API.BaseUrl + item.recommend_url).into(imageView);
        helper.setText(R.id.tv_item_recommend_name, item.recommend_name);
        Log.d("HOMERE", "" + item.recommend_name);
        Log.d("HOMERE", "" + item.recommend_url);
    }
}
